home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / misc / e-n / hsc / src_docs / features / absuris.hsc next >
Text File  |  1995-10-03  |  2KB  |  92 lines

  1. <$INCLUDE FILE="inc/macro.hsc">
  2. <WEBPAGE chapter="hsc - Features - " title="Absolute URIs">
  3.  
  4. Let's asume this directory structure for your html-project:
  5.  
  6. <PRE>
  7.      prj/
  8.      |
  9.      +-image/
  10.      | |
  11.      | +-back.gif
  12.      | |
  13.      | +-logo.gif
  14.      |
  15.      +-people/
  16.      | |
  17.      | +-hugo.html
  18.      | |
  19.      | +-hugo.gif
  20.      | |
  21.      | :
  22.      |
  23.      +-main.html
  24. </PRE>
  25.  
  26. If e.g. "main.html" wants to refer to "logo.gif", the situation is
  27. quite clear: Insert a
  28.  
  29.   <BLOCKQUOTE>
  30.   <TG>IMG SRC="image/logo.gif"</TG>
  31.   </BLOCKQUOTE>
  32.  
  33. in "main.html", and the logo will appear.
  34.  
  35. But what if "hugo.html" will display the same logo? With
  36. relative URIs (as supported by html), you will have to
  37. insert a
  38.  
  39.   <BLOCKQUOTE>
  40.   <TG>IMG SRC="../image/logo.gif"</TG>
  41.   </BLOCKQUOTE>
  42.  
  43. And a file located another directory lever deeper will have to use
  44. <TT>"../../image/logo.gif"</TT> as path. Within big projects, this
  45. becomes very annoying because you always have to know in which
  46. directory level the file you are currently editing is located.
  47. <P>
  48.  
  49. With absolute URIs, you can always use
  50.   <BLOCKQUOTE>
  51.   <TG>IMG SRC="image/logo.gif"</TG>
  52.   </BLOCKQUOTE>
  53. even from a file called e.g "people/ugly/blond/tall/sepp.html".<P>
  54.  
  55. This becomes even more useful with macros:
  56. for example, you could write a macro that inserts a button refering
  57. to your main page:
  58.   <BLOCKQUOTE><TT>
  59.   <$MACRO BUTTON_MAIN><BR>
  60.   <A HREF="main.html"><BR>
  61.   <IMG SRC="image/main.gif" ALT="Main"><BR>
  62.   </A><BR>
  63.   </$MACRO>
  64.   </TT></BLOCKQUOTE>
  65.  
  66. So you can add a button to your mainpage by simply using
  67.  
  68.   <BLOCKQUOTE><TT>
  69.   <BUTTON_MAIN><BR>
  70.   </TT></BLOCKQUOTE>
  71.  
  72. in any file of your project. And, that's the feature,
  73. independent of the location in the directory path of the calling file.<P>
  74.  
  75. Well, maybe the term "absolut URI" is not really correct. Absolut URIs don't
  76. refer to absolut paths on your local disk. The refer relative to the
  77. main directory of your project. Usually, this is the directory where your
  78. <TT>makefile</TT> is located and therefor <STRONG>hsc</STRONG> is envoked
  79. from. Everything clear now?<P>
  80.  
  81. Of course, in the destination HTML-file, all absolute URIs are converted
  82. to relativ URIs.<P>
  83.  
  84. To work with absolut URIs, enable the <A HREF="options.html">AbsUri</A>
  85. switch.<P>
  86.  
  87. <MAIN>
  88. <PREV href="features/checkuri.html">
  89. <NEXT href="features/macros.html">
  90. </WEBPAGE>
  91.  
  92.